package com.zhixin.zhixinmall.exception;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * @author cyc
 * @date 2023/10/08 15:45:13
 */
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@AllArgsConstructor
public class ZhixinMallException extends RuntimeException {
    private static final long serialVersionUID = 1L;

    private int code;
    private String msg;

    public ZhixinMallException(Exception e) {
        this.setCode(400);
        this.setMsg(e.getMessage());
    }

    public ZhixinMallException(String msg) {
        this.setCode(400);
        this.setMsg(msg);
    }

}
